﻿(function ($) {
    if (!$) return;
    $.fn.extend({
        fixPNG: function (sizingMethod, forceBG) {
            sizingMethod = sizingMethod || "scale"; 
            this.each(function() { 
				var isImg = (forceBG) ? false : jQuery.nodeName(this, "img"),
				    imgname = (isImg) ? this.src : this.currentStyle.backgroundImage,
					src = (isImg) ? imgname : imgname.substring(5,imgname.length-2);
				this.style['filter'] = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', enabled='true', sizingMethod='" + sizingMethod + "')"; 
				});
				return this;
               }}); 
})(jQuery);

$(function (){
  $('.png').fixPNG();
})